//
//  SaveHeader.swift
//  DSP
//
//  Created by tucici on 2024/5/23.
//

import UIKit
import TCCKit
class SaveItem: UIControl {
    var img : UIImageView!
    var title : UILabel!
    override init(frame: CGRect) {
        super.init(frame: frame)
        initUI()
    }
    
    required init?(coder: NSCoder) {
        fatalError("init(coder:) has not been implemented")
    }
    
    func initUI(){
        img = UIImageView()
        img.isUserInteractionEnabled = false
        
        title = UILabel()
        title.textHexColor = "#000000"
        title.font = font(16)
        title.numberOfLines = 0
        title.textAlignment = .center
        title.isUserInteractionEnabled = false
        title.minimumScaleFactor = 0.8
        title.adjustsFontSizeToFitWidth = true
        
        addSubview(img)
        addSubview(title)
        
        img.snp.makeConstraints { make in
            make.left.equalToSuperview().offset(10)
            make.width.greaterThanOrEqualTo(20)
            make.centerY.equalToSuperview()
        }
        
        title.snp.makeConstraints { make in
            make.left.equalTo(img.snp.right).offset(10)
            make.top.bottom.right.equalToSuperview().inset(5)
        }
    }
}
